package com.Ajava1704.for并发包下的类.ForCycliyer;

import java.util.concurrent.CyclicBarrier;

/**
 * @类名: com.Ajava1704.for并发包下的类.ForCycliyer
 * @作者: lgt
 * @创建时间: 2020-02-11 20:51
 * @描述:
 **/
public class ForTestCyclibier {
    public static void main(String[] args) {
        CyclicBarrier cyclicBarrier=new CyclicBarrier(3);

        Thread thread=new Thread(new ForCycliRunable(cyclicBarrier,2),"A");
        thread.start();

        Thread thread2=new Thread(new ForCycliRunable(cyclicBarrier,5),"B");
        thread2.start();

        Thread thread3=new Thread(new ForCycliRunable(cyclicBarrier,3),"C");
        thread3.start();

        //================================
        Thread thread4=new Thread(new ForCycliRunable(cyclicBarrier,2),"E");
        thread4.start();

        Thread thread5=new Thread(new ForCycliRunable(cyclicBarrier,5),"F");
        thread5.start();

        Thread thread6=new Thread(new ForCycliRunable(cyclicBarrier,3),"G");
        thread6.start();

        System.out.println("=====================");
    }
}
